<?php
namespace Home\Controller;
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/3/5
 * Time: 16:08
 */
use Goji\UserModel;
use Think\Controller;
class UserBaseController extends Controller
{
    public $uid = 3;
    public $mid = 1;
    public $userInfo = array();

    function __construct() {
        parent::__construct();
        // $onCotrollerArr = array('Weixin');
        //$noCheckAction = array('superAdminLogin','adminLogin');
        /*if(!in_array(CONTROLLER_NAME,$onCotrollerArr)) {
            $this->checkUserLogin();
        }*/
        $noCheckAction = array('apply_account','get_apply_account','get_province','get_city','master_login','get_index_banner','set_index_banner');
        if(!in_array(ACTION_NAME,$noCheckAction)) {
            $this->checkUserLogin();
        }


        $this->userInfo = array('uid' => 1,'nickname' => 'clq','openid' => '123456');
    }

    /**
     * 验证管理员是否登入
     */
    public function checkUserLogin(){
        $uid = $_SESSION['uid'];
        if(!$uid){
            returnMobileJson(0,'','未登入');
        }else{
            $this->uid = $_SESSION['uid'];
        }

    }

    public function jurisdiction(){

    }
}